package A;

import javax.swing.*;
import java.awt.*;

public class ch6_2 {
    public static void main(String[] args) {
        JFrame frame = new JFrame("登录系统");
        JPanel panel = new JPanel();
        panel.setBackground(Color.BLUE);
        JLabel label = new JLabel("请输入用户名与密码");
        JLabel label1 = new JLabel("用户名");
        JLabel label2 = new JLabel("密码");
        JTextField textField = new JTextField(10);
        JPasswordField passwordField = new JPasswordField(10);
        JButton button = new JButton("登录");
        JButton button1 = new JButton("重置");

        panel.add(label);
        panel.add(label1);
        panel.add(textField);
        panel.add(label2);
        panel.add(passwordField);
        panel.add(button);
        panel.add(button1);

        frame.add(panel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(500, 500);
        frame.setVisible(true);
    }
}
